import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/sys/user/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

//获取用户菜单树
export function userMenus() {
  return request({
    url: '/sys/user/menus',
    method: 'GET'
  })
}

//用户更新密码
export function userPwd(data) {
  return request({
    url: '/sys/user/update-pwd',
    method: 'POST',
    data
  })
}
//用户更头像
export function userProfile(data) {
  return request({
    url: '/sys/user/profile',
    method: 'put',
    data
  })
}
//用户更新基本新
export function userAvatar(data) {
  return request({
    url: '/sys/user/avatar',
    method: 'put',
    data
  })
}